package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.NewsReportMapper;
import com.ruoyi.system.domain.NewsReport;
import com.ruoyi.system.service.INewsReportService;

/**
 * 舆情报告Service业务层处理
 * 
 * @author shan
 * @date 2025-02-28
 */
@Service
public class NewsReportServiceImpl implements INewsReportService 
{
    @Autowired
    private NewsReportMapper newsReportMapper;

    /**
     * 查询舆情报告
     * 
     * @param id 舆情报告主键
     * @return 舆情报告
     */
    @Override
    public NewsReport selectNewsReportById(Long id)
    {
        return newsReportMapper.selectNewsReportById(id);
    }

    /**
     * 查询舆情报告列表
     * 
     * @param newsReport 舆情报告
     * @return 舆情报告
     */
    @Override
    public List<NewsReport> selectNewsReportList(NewsReport newsReport)
    {
        return newsReportMapper.selectNewsReportList(newsReport);
    }

    /**
     * 新增舆情报告
     * 
     * @param newsReport 舆情报告
     * @return 结果
     */
    @Override
    public int insertNewsReport(NewsReport newsReport)
    {
        newsReport.setCreateTime(DateUtils.getNowDate());
        return newsReportMapper.insertNewsReport(newsReport);
    }

    /**
     * 修改舆情报告
     * 
     * @param newsReport 舆情报告
     * @return 结果
     */
    @Override
    public int updateNewsReport(NewsReport newsReport)
    {
        return newsReportMapper.updateNewsReport(newsReport);
    }

    /**
     * 批量删除舆情报告
     * 
     * @param ids 需要删除的舆情报告主键
     * @return 结果
     */
    @Override
    public int deleteNewsReportByIds(Long[] ids)
    {
        return newsReportMapper.deleteNewsReportByIds(ids);
    }

    /**
     * 删除舆情报告信息
     * 
     * @param id 舆情报告主键
     * @return 结果
     */
    @Override
    public int deleteNewsReportById(Long id)
    {
        return newsReportMapper.deleteNewsReportById(id);
    }
}
